def sqrt(x):
    return int(x ** 0.5)


def upper(k, n):
    return sqrt(n / k) + 1


def is_square(x):
    root = sqrt(x)
    return x == root * root


def solution(n):
    for a in range(upper(4, n)):
        i = a * a
        for b in range(a,  upper(3, n)):
            j = b * b + i
            for c in range(b, upper(2, n)):
                k = c * c + j

                d_square = n - k
                if d_square >= c * c:
                    if is_square(d_square):
                        d = sqrt(d_square)
                        print(a, b, c, d)
                        return


solution(int(input()))